home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5765 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  43 lines

  1. Path: rcp6.elan.af.mil!rscernix!danpop
  2. From: danpop@mail.cern.ch (Dan Pop)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Calendar time
  5. Date: 20 Feb 96 23:37:19 GMT
  6. Organization: CERN European Lab for Particle Physics
  7. Message-ID: <danpop.824859439@rscernix>
  8. References: <312670A6.71F3@liant.com> <3129eb1d.1840152@news.iquest.net>
  9. NNTP-Posting-Host: ues5.cern.ch
  10. X-Newsreader: NN version 6.5.0 #7 (NOV)
  11.  
  12. In <3129eb1d.1840152@news.iquest.net> rclark@iquest.net (Robert B. Clark) writes:
  13.  
  14. >[Posted and emailed]
  15. >
  16. >On Sat, 17 Feb 1996 18:19:50 -0600, Robert Barron <barron@liant.com>
  17. >wrote:
  18. >
  19. >>hours is off.  Is there a simple routine available that will break down 
  20. >>a time_t variable into it's constituent parts without any conversion?
  21. >
  22. >Presumably, time_t is just a long int that represents the number of
  23. >seconds since 1 Jan 1970 at 00:00:00 GMT.
  24.  
  25. "Presumably" is the keyword here.  On my system:
  26.  
  27. #ifndef _TIME_T
  28. #define _TIME_T
  29. typedef int             time_t;
  30. #endif
  31.  
  32. But time_t can be any arithmetic type and the time is encoded in an
  33. implementation-specific way.
  34.  
  35. The routines to break down a time_t variable are gmtime and localtime.
  36.  
  37. Dan
  38. --
  39. Dan Pop
  40. CERN, CN Division
  41. Email: danpop@mail.cern.ch 
  42. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  43.